package com.bit.leetcode;

import java.util.Scanner;

public class day_1025 {
    //剑指offer_63 股票的最大利润
    //思想：动态规划
    class Solution {
        public int maxProfit(int[] prices) {
            int cost = Integer.MAX_VALUE;
            int profit = 0;
            for(int price:prices){
                cost = Math.min(cost,price);
                profit = Math.max(profit,price-cost);
            }
            return profit;
        }
    }

    public static void main1(String[] args) {
        String s1 = "abc"+"def";
        String s2 = new String(s1);
        if(s1.equals(s2)) System.out.println("111");
        if (s1 == s2) System.out.println("2222");
    }

}
